package com.Classroom.al.services;

import com.Classroom.al.dao.ClassroomRepository;
import com.Classroom.al.entities.Classroom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassroomService {

    @Autowired
    ClassroomRepository classroomRepository;

    public List<Classroom> getAll(){
        return classroomRepository.findAll();

    }
    public Classroom getClassroomById(long id){
        return classroomRepository.getById(id);
    }
public Classroom save(Classroom classroom){
        return classroomRepository.save(classroom);
    }
    public void delClassroom(long id){
        classroomRepository.deleteById(id);
    }
}
